var testConfig = require('../testConfig');
function TestProject() {
  this.init = function () {
    var arr = [];
    arr.push(
      this.step1,
      this.step2,
      this.step3,
      this.step4,
      this.step5,
      this.step6,
      this.step7,
      this.step8,
      this.step9,
      //this.step10,
      this.step11,
      this.step12,
      this.step13,
      this.step14,
      this.step15,
      this.step16,
      this.step17,
      this.step18,
      this.step19,
      this.step20,
      this.step21,
      this.step22,
      this.step23,
      this.step24
    );
    testConfig.testFun.runStep(arr);
  };
  var uploadImg = "http://choosefine-uat.oss-cn-hangzhou.aliyuncs.com/shopping/user/20170704140050ninZMbBaTs.jpg";
  this.step1 = function () {
    $("#aside-nav").find("div.coords").eq(2).find("a")[0].click();
  };
  this.step2 = function () {
    testConfig.testFun.ai().find('.addProject')[0].click();
  };
  this.step3 = function () {
    testConfig.testFun.bi().find("input[data-name='projectName']").val("姬自动化测试");
  };
  this.step4 = function () {
    testConfig.testFun.bi().find("input[data-name='contractorName']").val('姬项目经理测试').attr('managerusercode', 'PS7022179U5033');
  };
  this.step5 = function () {
    testConfig.testFun.bi().find("#wrap_a img").attr("src", uploadImg);
  };
  this.step6 = function () {
    testConfig.testFun.bi().find("input[data-name='constructionUnit']").val('汤建筑公司一').attr('constructusercode', 'CP3210322DCS');
};
  this.step7 = function () {
    testConfig.testFun.bi().find("#wrap_b img").attr("src", uploadImg);
  };
  this.step8 = function () {
    testConfig.testFun.bi().find("input[data-name='constructUnit']").val("下沙建筑公司");
  };
  this.step9 = function () {
    testConfig.testFun.bi().find("input[data-name='projectStart']").val('2017-05-14');
  };
  //this.step10 = function () {
  //  testConfig.testFun.bi().find("td.today")[0].click();
  //};
  this.step11 = function () {
    testConfig.testFun.bi().find("#province").attr({
      'my-name': '山西省',
      'my-id': '140000'
    }).html("<option value='140000'>山西省</option>");
  };
  this.step12 = function () {
    testConfig.testFun.bi().find("#city").attr({
      'my-name': '太原市',
      'my-id': '140100'
    }).html("<option value='140100'>太原市</option>");
  };
  this.step13 = function () {
    testConfig.testFun.bi().find("input[data-name='projectAddress']").val("南内环街");
  };
  this.step14 = function () {
    testConfig.testFun.bi().find("select[data-name='projectType']").attr({'my-name': '建筑材料'}).html("<option value='1'>房屋建筑工程</option>");
  };
  this.step15 = function () {
    testConfig.testFun.bi().find("input[data-name='projectTotalPrice']").val("66");
  };
  this.step16 = function () {
    testConfig.testFun.bi().find(".resure")[0].click();
  };
  this.step17 = function () {
    testConfig.testFun.ci().find(".finish")[0].click();
  };
  this.step18 = function () {

  };
  this.step19 = function () {
    testConfig.testFun.di().find(".finish")[0].click();
  };
  this.step20 = function () {

  };
  this.step21 = function () {
    testConfig.testFun.ei().find(".finish")[0].click();
  };
  this.step22 = function () {

  };
  this.step23 = function () {
    testConfig.testFun.ai().find("input[data-name='projectName']").val("姬自动化测试");
  };
  this.step24 = function () {
    testConfig.testFun.ai().find("#teamCapitalBtn").click();
  };
}
function testStart() {
  var test = new TestProject();
  test.init();
}
exports.start = testStart;
